
from typing import List

class User():
    def __init__(self, record) -> None:
        self.id : int = record['id']
        self.username : str = record['username']
        self.nickname : str = record['nickname']
        self.mobile : str = record['mobile']
        self.email : str = record['email']
        self.avatar : str = record['avatar']
        self.roles : List[str] = [x for x in record['roles'].split(';') if x] if record['roles'] else []
        self.introduction : str = record['introduction']
        self.erased: int = record['erased'] if record else 0
        
    def isadmin(self) -> bool:
        return 'admin' in self.roles